import request from '@/utils/request';

//登录
export const login = (username, password) => {
    return request({
        url: '/admin/acl/login',
        method: 'post',
        data: {
            username,
            password
        }
    })
}

//获取用户信息
export const getInfo = (token) => {
    return request({
        url: '/admin/acl/index/info',
        method: 'get',
        headers: {
            token
        },
    })
}

//获取所有公司信息
export const getAllCompany = () => {
    return request({
        url: '/eduM2/company/getAllCompany',
        method: 'post',
    })
}

//登出
export const logout = () => {
    return request({
        url: '/admin/acl/index/logout',
        method: 'post',
    })
}

//获取验证码
export const getCaptcha = () => {
    return request({
        url: '/admin/acl/verify/getCaptcha',
        method: 'get',
    })
}

//检查验证码
export const checkCaptcha = (captcha, sessionId) => {
    return request({
        url: '/admin/acl/verify/checkCaptcha/' + captcha + '/' + sessionId,
        method: 'get',
    })
}

//刷新token
// export const refeshToken = (refreshToken) => {
//     return request({
//         url:  '/crazy-auth/token',
//         method: 'post',
//         headers: {
//             'User-Type': 'student'
//         },
//         params: {
//             grantType: "refresh_token",
//             refreshToken: refreshToken
//         }
//     })
// }

//检查token
// export const checkToken = (token) => {
//     return request({
//         url:  '/crazy-auth/checkToken',
//         method: 'post',
//         params: {
//             token
//         }
//     })
// }






